function getName(name: string): void;
function getName(person: object): void;
function getName(x): void {
  if(typeof x == 'string') {
    console.log(x);
  } else {
    console.log('This person\'s name is: ' + x.name);
  }
}

getName('Lucy');
getName({
  name: 'Lucy',
  age: 21
});
